class Admin::ProjectsController < Admin::ApplicationController
  def index
    # @projects = Project.all
    @projects = Project.joins(:money_requires).page( params[:page] )
  end

  def destroy
    @projects = Project.find(params[:id])
    if !@projects.blank?
    	@projects.update_attributes(:deleted_at => Time.now.utc)
    end
    render_success("[项目删除成功]")
    return
  end

  def sort
    _sort = params[:sort].to_i
    _id = params[:id].to_i
    _project = Project.find(_id)
    _project.sort = _sort
    _project.save
    render_success("[项目排序修改成功]")
  end
end
